#ifndef TIMER_H
#define TIMER_H

#include <time.h>

class timer
{
private:
    double begTime;
public:
    void start()
    {
        begTime = clock();
    }

    double elapsedTime()
    {
        return ((unsigned long) clock() - begTime) / CLOCKS_PER_SEC;
    }

    bool isTimeout(unsigned long seconds)
    {
        return seconds >= elapsedTime();
    }

};

#endif // TIMER_H
